package vcproj2cmake;

import java.io.File;
import java.io.IOException;

import vcproj2cmake.reader.SolutionReader;
import vcproj2cmake.writer.SolutionWriter;

public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		if (args.length != 3){
			System.err.println("<Usage>::solutionfile.sln workspacePath \"Configurationname\"");
			System.exit(1);
		}
		
		File solutionFile = new File(args[0]);//new File("E:/Diplomarbeit/workspace/VisionEdit/VisionEdit.sln");
		File workspacepath = new File(args[1]);
		String config = args[2];
		SolutionReader sr = new SolutionReader();
		
		Solution solution = sr.readSolution(solutionFile, workspacepath);// new File("E:/Diplomarbeit/workspace"));
		if (solution == null){
			System.err.println("Could not read solution file or projects");
			System.exit(1);
		}
		
		SolutionWriter sw = new SolutionWriter();
		sw.writeSolutionToCMakeLists(solution, config);
		System.out.println("Export succssesfull");
		System.exit(0);
	}

}
